
export interface IData {
  name: string
  value: number
}
export const getOptions = (name: string, data: IData[]) => {
  const option = {
    color: [
      '#7A61FF',
      '#6CECA6',
      '#3886FF',
      '#fac858',
      '#ee6666',
      '#73c0de',
      '#3ba272',
      '#fc8452',
      '#9a60b4',
      '#ea7ccc'
    ],
    legend: {
      bottom: '10px',
      left: 'center',
      textStyle: {
        color: '#fff'
      }
    },
    tooltip: {
      trigger: 'item'
    },
    series: [
      {
        name,
        type: 'pie',
        radius: ['40%', '70%'],
        bottom: '20px',
        avoidLabelOverlap: false,
        label: {
          show: true,
          color: '#fff',
          position: 'center'
        },
        emphasis: {
          label: {
            show: true,
            fontSize: 40,
            fontWeight: 'bold'
          }
        },
        labelLine: {
          show: false
        },
        data
      }
    ]
  }
  return option
}